<?php
//引入需用的类
use yii\helpers\Html;
?>

<!-- 2.修改form action,lay-filter的值,修改数据表格的lay-filter,稍后layui渲染数据需要
    3.批量修改name的数组名,一般改为类名,如ConfigBase- 改为 ConfigSysinfo-,便于后端能使用load()和validate()时能自动获取并验证
    4.修改字段名,如ConfigSysinfo[id]中,id改为siteid
    5.修改字段值,如$model->title 改为 $model->siteid
    6.修改字段展示的文字
-->
        <form method="post" class="layui-form" action="<?=\yii\helpers\Url::toRoute(['create'])?>" lay-filter="configSysinfo">
            <div class="layui-form-item">
                <input name="ConfigSysinfo[siteid]" type="hidden" value="<?=$model->siteid?>" />
                <input name="_csrfBackend" type="hidden" value="<?=\Yii::$app->request->csrfToken?>" />

                <label for="ConfigSysinfo-name" class="layui-form-label">
                    站点名
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="ConfigSysinfo-name" name="ConfigSysinfo[name]" value="<?=$model->name?>" placeholder="请输入站点名" required="" lay-verify="required"
                           autocomplete="off" class="layui-input">
                </div>
            </div>


            <div class="layui-form-item">
                <label for="ConfigSysinfo-dirname" class="layui-form-label">
                站点目录
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="ConfigSysinfo-dirname" name="ConfigSysinfo[dirname]" value="<?=$model->dirname?>" placeholder="请输入站点目录" required="" lay-verify="required"
                           autocomplete="off" class="layui-input">
                </div>
            </div>


            <div class="layui-form-item">
                
                <label for="ConfigSysinfo-domain" class="layui-form-label">
                域名
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="ConfigSysinfo-domain" name="ConfigSysinfo[domain]" value="<?=$model->domain?>" placeholder="请输入域名" required="" lay-verify="required"
                           autocomplete="off" class="layui-input" >
                </div>
            </div>


            <div class="layui-form-item">                
                <label for="ConfigSysinfo-serveralias" class="layui-form-label">
                域名别名
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="ConfigSysinfo-serveralias" name="ConfigSysinfo[serveralias]" value="<?=$model->serveralias?>" placeholder="域名别名，多个以“,”分割" required="" lay-verify="required"
                           autocomplete="off" class="layui-input">
                </div>
            </div>


            <div class="layui-form-item">
                <label for="ConfigSysinfo-keywords" class="layui-form-label">
                SEO关键词
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="ConfigSysinfo-keywords" name="ConfigSysinfo[keywords]" value="<?=$model->keywords?>" placeholder="请输入SEO关键词" required="" lay-verify="required"
                           autocomplete="off" class="layui-input">
                </div>
            </div>


            <div class="layui-form-item">
                
                <label for="ConfigSysinfo-description" class="layui-form-label">
                站点描述
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="ConfigSysinfo-description" name="ConfigSysinfo[description]" value="<?=$model->description?>" placeholder="请输入站点描述" required="" lay-verify="required"
                           autocomplete="off" class="layui-input">
                </div>
            </div>


            <div class="layui-form-item">                
                <label for="ConfigSysinfo-site_point" class="layui-form-label">
                发布点
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="ConfigSysinfo-site_point" name="ConfigSysinfo[site_point]" value="<?=$model->site_point?>" placeholder="请输入发布点" required="" lay-verify="required"
                           autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">                
                <label for="ConfigSysinfo-smarty_id" class="layui-form-label">
                使用的模板ID
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="ConfigSysinfo-smarty_id" name="ConfigSysinfo[smarty_id]" value="<?=$model->smarty_id?>" placeholder="请输入模板ID" required="" lay-verify="required"
                           autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">                
                <label for="ConfigSysinfo-smarty_app_id" class="layui-form-label">
                移动端模板ID
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="ConfigSysinfo-smarty_app_id" name="ConfigSysinfo[smarty_app_id]" value="<?=$model->smarty_app_id?>" placeholder="请输入移动端模板ID" required="" lay-verify="required"
                           autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">                
                <label for="ConfigSysinfo-address" class="layui-form-label">
                站点主管单位地址
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="ConfigSysinfo-address" name="ConfigSysinfo[address]" value="<?=$model->address?>" placeholder="站点主管单位地址" required="" lay-verify="required"
                           autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">                
                <label for="ConfigSysinfo-zipcode" class="layui-form-label">
                站点主管单位邮编
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="ConfigSysinfo-zipcode" name="ConfigSysinfo[zipcode]" value="<?=$model->zipcode?>" placeholder="请输入站点主管单位邮编" required="" lay-verify="required"
                           autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">                
                <label for="ConfigSysinfo-tel" class="layui-form-label">
                站点主管单位电话
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="ConfigSysinfo-tel" name="ConfigSysinfo[tel]" value="<?=$model->tel?>" placeholder="请输入站点主管单位电话" required="" lay-verify="required"
                           autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">                
                <label for="ConfigSysinfo-fax" class="layui-form-label">
                传真
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="ConfigSysinfo-fax" name="ConfigSysinfo[fax]" value="<?=$model->fax?>" placeholder="请输入传真" required="" lay-verify="required"
                           autocomplete="off" class="layui-input">
                </div>
            </div>

           

            <div class="layui-form-item">
                <label for="L_repass" class="layui-form-label">
                </label>
                <button  class="layui-btn" lay-filter="add" lay-submit="">
                    提交
                </button>
            </div>
        </form>

<!-- 
//数据表格
//表格元素
//搜索表单
//绑定js


-->

<?php
$jsStr = <<<STR
    function(value){
       
    }
STR;
//$jsStr = isset($unitInfo['password_hash']) ? $jsStr : "[/(.+){6,12}$/, '密码必须6到12位']";

$tableJs = <<<JS
    layui.use(['form', 'layer'],function() {
        $ = layui.jquery;  var form = F(layui.form), layer = layui.layer;

        //自定义验证规则
        /* form.verify({
            name: function(value) {
                if (value.length < 0) {
                    return '请输入昵称';
                }
            }
        }); */
        //监听提交
        var sFun = function (jsonData) {
                layer.close(load);
                var ic = (jsonData.status == true) ? icon.ICON_OK : icon.ICON_ERROR;
                layer.msg(jsonData.msg,{icon:ic},function () {
                    if(jsonData.status == true){
                        xadmin.father_reload();
                        xadmin.close();                    
                    }
                });
        };
        form.submit('add','',sFun);
    });
JS;
$this->registerJs($tableJs,\yii\web\View::POS_END);
?>









